# encoding = utf-8
class CreateProducts < ActiveRecord::Migration
  def self.up
    create_table :products do |t|
      t.string :name
      t.integer :type_id
      t.float :price
      t.integer :discount, :default => 10
      t.integer :stock, :default => 0
      t.string :brief
      t.text :description

      t.timestamps
    end
    
    add_index :products, :type_id,                :unique => false
  end

  def self.down
    drop_table :products
  end
end
